package com.gh.blog.controller;

import com.gh.blog.dto.ArticleDto;
import com.gh.blog.entity.Article;
import com.gh.blog.service.ArticleService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Fawn
 * @Date 2020/9/10 9:40
 * @Version 1.0
 **/
@RestController
public class ArticleController {

    @Autowired
    private ArticleService articleService;

    @GetMapping("findArticleByPage")
    public Object findAllArticleByPage(@RequestParam("current") Integer current,
                                                     @RequestParam("size") Integer size){
        PageInfo page = articleService.findAllArticleByPage(current, size);
        return page;
    }
}
